
#ifndef LINKTREE_H
#define LINKTREE_H

#pragma once
/////////////////////////////////////////////////////////////////////////////
// CLinkTree window
#include "ScrollBarEx.h"
class CLinkTree : public CTreeCtrl
{
// Construction
public:
	CLinkTree();
	virtual ~CLinkTree();
    void InitTree();
	bool isInited;
protected:
    int m_space;
    int m_ItemHeight;
// Attributes
public:
    void ScrollBarShow(bool isShow );
    INT SortItem(HTREEITEM hItem);
// Operations
public:
    void NewTextCome(WPARAM wParam,LPARAM lParam);
    void NewMsgCome(WPARAM wParam,LPARAM lParam);
    void FlashUserItem(int Flash,DWORD nIDEvent);
    void EditUserItem(WPARAM wParam, int nType);
    void EditPhoneItem(WPARAM wParam, int nNum);

protected:
    void On_Dblclk(HTREEITEM hItem);
    void DrawBack(CDC *pDC,int nItemState,CRect rect);
    void DrawFocusRect(CDC* pDC,LPCRECT lpRect);
    void DrawBmp(CDC *pDC,HTREEITEM hTreeItem,CRect rect,int flash);
    void DrawText(CDC *pDC,HTREEITEM hTreeItem,CRect rect);

	// Generated message map functions
protected:
	virtual void PreSubclassWindow();
    COLORREF crBkColor;
    COLORREF crTextColor;
	//{{AFX_MSG(CLinkTree)
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
    afx_msg void OnCustomDraw(NMHDR *pNMHDR, LRESULT *pResult);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnPaint();
	afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
	//}}AFX_MSG
private:
	CScrollBarEx m_HScroll;
	CScrollBarEx m_VScroll;
	DECLARE_MESSAGE_MAP()
};

#endif // LINKTREE_H
